<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
 <h1>获得用户提交的值:</h1>
 <%
   request.setCharacterEncoding("utf-8");//
   String ip=request.getRemoteHost();//ip
   String name=request.getParameter("userName");
   String pass=request.getParameter("userPass");
   String age=request.getParameter("age");//数字
   int a=Integer.parseInt(age);//new Integer(age);
   String[]likes=request.getParameterValues("like");
   
 %>
 <div>
   <h2>ip:<%=ip%></h2>
   <h2>姓名:<%=name%></h2>
   <h2>密码:<%=pass%></h2>
   <h2>年龄:<%=a%></h2>
   <h2>爱好:
     <%
       if(likes!=null){
    	   for(String s:likes)
    		   out.print(s+"&nbsp;&nbsp;&nbsp;");
       }
     %>
   </h2>
 </div>
</body>
</html>